function result(tbl){
	
	if(!isEmpty(tbl.id)){
		let exam_result=$fetch("exam_result",Cnd.where("id","=",tbl.id))
		attr("course",$fetch("course",Cnd.where("id","=",exam_result.course_id)))
		return foJson(exam_result.tbl);
	}else{
		if(isEmpty(tbl.course_id)){
			return ">>:404.html";
		}
		attr("course",$fetch("course",Cnd.where("id","=",tbl.course_id)))
		var exam=$fetch("exam",Cnd.where("course_id","=",tbl.course_id))
		
		var rs=foJson(tbl.result)
		var map=new HashMap();
		var list=new ArrayList();
		rs.forEach(function(d){
			var map1=new HashMap();
			map1.put(d.name,d.uval)
			map1.put("status",d.uval==d.val)
			map1.put("score",map1.status?2:0)
			list.add(map1)
		})
		map.put("start_time",tbl.start_time)
		map.put("end_time",tbl.end_time)
		let u=user();
		map.put("user_id",u.id||0)
		
		map.put("result",toJson(list))
		map.put("tbl_id",tbl.course_id)
//		tbl.put("result",rs)
		map.put("tbl",toJson(tbl))
		map.put(".table","exam_result")
		print(map)
		$mager(map)
		
//		attr("result",toJson(rs))
		return foJson(toJson(tbl));
	}
}